package sp.service.impl;

import org.springframework.mail.MailSender;
import org.springframework.mail.SimpleMailMessage;

import sp.service.MailService;

//@Service("mailService")
public class MailServiceImpl implements MailService {

	//@Autowired
	private SimpleMailMessage mailMessage;
	
	//@Autowired
	private MailSender mailSender;
	
	
	
	
	@Override
	public void sendActivateCode(String mailTo, String activateCode) throws Exception {
		//封装邮件对象
		mailMessage.setTo(mailTo);
		//发送平台生成的激活码 
		mailMessage.setText("您的激活码是:" + activateCode);
		//发送邮件
		mailSender.send(mailMessage);
	}

}
